<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="EN">
<head>
    <title>运单信息</title>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <style type="text/css">
        /*这是将打印时的页面大小设置为A4大小，并保留好一定的边距*/
        @page {
            size: 21cm 14.8cm;
            font-size: 14pt;
            color: black;
            line-height: 1.4;
            text-align: justify;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: SimSun, serif;
            page-break-inside: avoid; /* 避免在内容中间分页 */
        }

        .container {
            /*需要将预览显示的界面限定在A4大小*/
            width: 205mm;
            /*这个高度为什么不是A4的大小，是经过N次验证的方式得到的，唯一的目的就是为了保证预览和打印预览一致*/
            /*可能是我写的有一点问题，但是如果设置为297，那么显示就会出现问题*/
            height: 142mm;
            /* margin-bottom: 24mm; */
            background-color: white;
        }

        table {
            width: 95%;
            border-collapse: collapse;
            margin: 0 auto;
        }

        th, td {
            border: 1px solid #ccc;
            padding: 8px;
            text-align: left;
        }

        th {
            background-color: #f2f2f2;
        }

    </style>
</head>
<body>
<div class="container" th:each="shipment:${printList}">
    <h3 style="text-align: center;" th:text="'云南七彩比特物流运单信息(' + ${shipment.time} + ')'"></h3>
    <table>
        <tr>
            <th>运单号</th>
            <td th:text="${shipment.shipmentCode}">S2403000004</td>
            <th>司机名称</th>
            <td th:text="${shipment.outDriver}">李辉（干线）</td>
            <th>车牌号</th>
            <td th:text="${shipment.license}">云AK7879</td>
            <td rowspan="2">
                <img style="width: 80px;height: 80px;" th:src="${shipment.codeImg}"/>
            </td>
        </tr>
        <tr>
            <th>起运站</th>
            <td th:text="${shipment.fromOrganizationName}">七彩比特物流</td>
            <th>目的站</th>
            <td th:text="${shipment.toOrganizationName}">开远七彩比特</td>
            <th>电话</th>
            <td th:text="${shipment.outPhone}">13698782054</td>
        </tr>
        <!-- 添加更多运单信息 -->
    </table>
    <br/>
    <h3 style="text-align: center;">装载订单信息</h3>
    <table>
        <tr>
            <th style="width: 110px;">订单号</th>
            <th>下单时间</th>
            <th>收货地址</th>
            <th>收货人</th>
            <th>电话</th>
            <th>数量</th>
            <th>回单</th>
        </tr>
        <tr data-th-each="led: ${shipment.leds}">
            <td th:text="${led.code}">123456789</td>
            <td th:text="${led.time}">123456789</td>
            <td th:text="${led.party.detaileAddress}">123456789</td>
            <td th:text="${led.party.contactperson}">123456789</td>
            <td th:text="${led.party.iphone}">123456789</td>
            <td th:text="${led.number}">123</td>
            <td th:text="${led.backNumber}">1</td>
        </tr>
        <!-- 添加更多运单信息 -->
    </table>
    <h3 style="text-align: center;">汇总信息</h3>
    <table>
        <tr>
            <th>订单数量</th>
            <td th:text="${ledCount}">10</td>
            <th>货品数量</th>
            <td th:text="${goodsCount}">120</td>
            <th>司机签字</th>
            <td style="width: 100px;"></td>
        </tr>
    </table>
</div>
</body>
</html>